/*
 * NT.H Version 1.01 (C)1995,1996 HUDSON SOFT
 * HuC6261(New鉄観音)関連 Ｃコンパイラ用ヘッダーファイル(NT.H)
 */

#ifndef _NT_H_
#define _NT_H_

#include	<system.h>

/* register set macros */

#define _put_nt_ar(x) __OUTPORTH(IO_NT_AR,x)
#define _put_nt_dr(x) __OUTPORTH(IO_NT_DR,x)
#define _get_nt_sr() __INPORTH(IO_NT_SR)

#define bcel	0x0001
#define fcel	0x0003
#define bg	0x0100
#define spr	0x0200
#define bg0	0x0400
#define bg1	0x0800
#define bg2	0x1000
#define bg3	0x2000
#define rain	0x4000
#define alldev	rain+bg3+bg2+bg1+bg0+spr+bg

void dispon( int video_device_no );
void dispoff( int video_device_no );

void init_nt(void);


struct NT_PLO {u_short cpo0,cpo1,cpo2,cpo3;};
void set_pallet_offset(struct NT_PLO *plo);

void write_pallet_datas(u_short top,u_short *datas,int len);

struct NT_PRI {u_short pri0,pri1;};
void set_nt_pri(struct NT_PRI *pri);

struct NT_CRM {u_short crmy,crmu,crmv;};
void set_crm_yuv(struct NT_CRM *crm);

struct CELPRM {u_short fixc,celcr,celsp,cel1A,cel1B,cel2A,cel2B,cel3A,cel3B;};

void set_nt_cel(struct CELPRM *celp);

void cel_on( int video_device_no, int celunit );
void cel_off( int video_device_no );
void celsp_on( int bank_bit );
void celsp_off( int bank_bit );
void set_nt_prio( int video_dev_no, int prio );
void init_dispon_irq( void );
void dispon_req( int video_device_no );
void dispoff_req( int video_device_no );
void dispon_irq( void );

#define interlace	0b0000001100000010
#define line263		0b0000001100000000
#define line262		0b0000001100000001
#define shift1by2	0b0000001100000011
#define ext_sync	0b0000010000000100
#define	inter_sync	0b0000010000000000
#define mode_7M		0b0000100000001000
#define mode_5M		0b0000100000000000
#define mode_bg256	0b0100000001000000
#define mode_sp256	0b1000000010000000
#define mode_bg16	0b0100000000000000
#define mode_sp16	0b1000000000000000
#define	mode_normal	0b0000111100000010
void set_nt_mode( int mode );

#endif /* _NT_H_ */
